home *** CD-ROM | disk | FTP | other *** search
/ SGI Origin & Onyx2 Patches 1998 May / Origin and Onyx2 System Disk Patches May 1998.img / dist / patchSG0002839.idb / usr / include / sys / edt.h.z / edt.h
C/C++ Source or Header  |  1998-04-01  |  3KB  |  117 lines

  1. /* "Equiped Device Table and VME interrupts 
  2.  *
  3.  * Copyright (c) 1984 AT&T. All Rights Reserved
  4.  * Copyright 1989 Silicon Graphics, Inc.  All rights reserved.
  5.  */
  6.  
  7. #ifndef _SYS_EDT_H_
  8. #define _SYS_EDT_H_
  9.  
  10. #ident    "$Revision: 3.35 $"
  11.  
  12. #if !_LANGUAGE_ASSEMBLY
  13.  
  14. #define NBASE 3
  15.  
  16. typedef struct iospace {
  17.     unchar        ios_type;    /* io space type on the adapter */
  18.     iopaddr_t    ios_iopaddr;    /* io space base address */
  19.     ulong        ios_size;    
  20.     caddr_t        ios_vaddr;    /* kernel virtual address */
  21. } iospace_t;
  22.  
  23. #ifdef _KERNEL
  24.  
  25. typedef struct irix5_iospace {
  26.     unchar        ios_type;
  27.     app32_ulong_t    ios_iopaddr;
  28.     app32_ulong_t    ios_size;
  29.     app32_ptr_t    ios_vaddr;
  30. } irix5_iospace_t;
  31.  
  32. #endif    /*_KERNEL */
  33.  
  34. typedef struct edt edt_t;
  35. #include <sys/iobus.h>
  36.  
  37. struct edt {
  38.     uint_t        e_bus_type;    /* vme, scsi, eisa, pci... */
  39.     unchar        v_cpuintr;    /* cpu to send intr to */
  40.     unchar        v_setcpuintr;    /* cpu field is valid */
  41.     uint_t        e_adap;        /* adapter */
  42.     uint_t          e_ctlr;         /* controller identifier */
  43.     void*        e_bus_info;    /* bus dependent info */
  44.     int        (*e_init)(struct edt *);/* device init/run-time probe */
  45.     iospace_t    e_space[NBASE];
  46.     char            e_master_name[512]; 
  47.         void*           e_platform_private;/* platform-dependent private info */
  48.  
  49.     vertex_hdl_t    e_connectpt;    /* "parent" vertex for this device */
  50.                     /* may be physical rather than architectural */
  51.                     /* used to form canonical name for dev */
  52.  
  53.     vertex_hdl_t    e_master;    /* "master" vertex for this device. */
  54.                     /* Usually points to controller or adapter ASIC. */
  55.                     /* used to determine node that controls dev. */
  56.  
  57.  
  58.     device_desc_t    e_device_desc;    /* administrative description of a device */
  59.                     /* desired bandwidth allocation, interrupt */
  60.                     /* target, etc */
  61. };
  62.  
  63. #define e_base        e_space[0].ios_vaddr
  64. #define e_base2        e_space[1].ios_vaddr
  65. #define e_base3        e_space[2].ios_vaddr
  66. #define e_iobase    e_space[0].ios_iopaddr
  67. #define e_iobase2    e_space[1].ios_iopaddr
  68. #define e_iobase3    e_space[2].ios_iopaddr
  69.  
  70. /* e_bus_type */
  71. #define ADAP_NULL    0
  72. #define ADAP_VME    1
  73. #define ADAP_GFX    2
  74. #define ADAP_SCSI    3
  75. #define ADAP_LOCAL    4
  76. #define ADAP_GIO    5
  77. #define ADAP_EISA    6
  78. #define ADAP_IBUS    7
  79. #define ADAP_EPC    8
  80. #define ADAP_DANG    9
  81. #define ADAP_PCI    10
  82.  
  83. extern void *        edt_bus_info_get(edt_t *edt);
  84. extern vertex_hdl_t    edt_connectpt_get(edt_t *edt);
  85. extern vertex_hdl_t    edt_master_get(edt_t *edt);
  86. extern device_desc_t    edt_device_desc_get(edt_t *edt);
  87.  
  88. /* IBUS-specific data structures and constants */
  89. #define IBUS_SLOTSHFT    3
  90. #define IBUS_IOASHFT    0
  91. #define IBUS_IOAMASK    0x7    
  92.  
  93. #define EPC_SERIAL    0x1
  94. #define EPC_ETHER    0x2
  95.  
  96. typedef struct {
  97.     unsigned    ibus_module;    /* Name of module */
  98.     unsigned    ibus_unit;    /* Unit number for this particular dev */
  99.  
  100.     unsigned    ibus_adap;    /* Adapter encoding for slot & ioa */
  101.     unsigned    ibus_ctlr;    /* Mezz sub-controller number */
  102.  
  103.     int        ibus_proc;    /* logical ID for cpu-directed intrs */
  104. } ibus_t;
  105.  
  106. extern ibus_t     ibus_adapters[];
  107. extern int     ibus_numadaps;
  108.  
  109. #ifdef    _KERNEL
  110. extern struct edt edt[];
  111. extern int nedt;
  112. #endif
  113.  
  114. #endif /* !_LANGUAGE_ASSEMBLY */
  115.  
  116. #endif
  117.